import { fileURLToPath, URL } from 'node:url';

import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';

// https://vitejs.dev/config/
export default ({ mode }) => {
  // console.log("mode:", mode)
  const env=loadEnv(mode, process.cwd());

  return defineConfig({
    plugins: [vue(), vueJsx()],
    css: {
      preprocessorOptions: {
        less: {
          additionalData: '@import "./src/assets/style/base.less";',
        },
      },
    },
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('./src', import.meta.url)),
      },
    },
  })
}

